package com.suitsoft.ut.entity.base;


import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.suitsoft.ut.entity.IdEntity;
import com.suitsoft.ut.entity.account.User;

/**
 *专业
 *@author Suineg
 */
@Entity
@Table(name="LW_DISCIPLINE")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Discipline extends IdEntity{
	/** 专业名 */
	private String disciplineName;
	/** 最后操作人 */
	
	private User lastUser;
	
	/** 最后操作时间 */
	
	private Date opdate;
	
	/** 学院 */
	
	private College college;
	
	/** 学生 */
	
	private Set<Student> studentSet = new HashSet<Student>();
	@OneToMany(fetch = FetchType.LAZY,mappedBy = "discipline")
	public Set<Student> getStudentSet() {
		return studentSet;
	}

	public void setStudentSet(Set<Student> studentSet) {
		this.studentSet = studentSet;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "COLLEGE_ID")
	public College getCollege() {
		return college;
	}

	public void setCollege(College college) {
		this.college = college;
	}

	public String getDisciplineName() {
		return disciplineName;
	}

	public void setDisciplineName(String disciplineName) {
		this.disciplineName = disciplineName;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID")
	public User getLastUser() {
		return lastUser;
	}

	public void setLastUser(User lastUser) {
		this.lastUser = lastUser;
	}

	public Date getOpdate() {
		return opdate;
	}

	public void setOpdate(Date opdate) {
		this.opdate = opdate;
	}
}

